package v1

import (
	"github.com/gogf/gf/v2/frame/g"
)

// 注册
type RegisterReq struct {
	g.Meta   `path:"/member/register" method:"post" sm:"注册用户" tags:"公开"`
	Username string `json:"username" v:"required|length:3,12"  dc:"用户名"`
	Password string `json:"password" v:"required|length:6,16"  dc:"密码"`
	Email    string `json:"email" v:"required|email"  dc:"邮箱"`
}

type RegisterRes struct {
}

// 登陆: 采用JWT
type LoginReq struct {
	g.Meta   `path:"/member/login" method:"post" sm:"登录,jwt模式" tags:"公开"`
	Username string `json:"username" v:"required|length:3,12" dc:"用户名"`
	Password string `json:"password" v:"required|length:6,16" dc:"密码"`
}

type LoginRes struct {
	Token string `json:"token" dc:"在需要鉴权的接口中header加入Authorization: token"`
}

// 登陆: 使用session
type LoginWSReq struct {
	g.Meta   `path:"/member/login_ws" method:"post" sm:"登录,使用session" tags:"公开"`
	Username string `json:"username" v:"required|length:3,12" dc:"用户名"`
	Password string `json:"password" v:"required|length:6,16" dc:"密码"`
}

type LoginWSRes struct {
}
